package com.wx.app.mylib.app;

import android.os.Bundle;
import android.widget.Toast;

import com.example.administrator.mylib.R;
import com.wx.app.mylib.utils.DensityUtils;
import com.zhy.autolayout.AutoLayoutActivity;

public class BaseActivity extends AutoLayoutActivity {

    public static BaseActivity mActivity;
    public LocalData mLocalData;

    public String sidKey = LocalData.CacheKey.sessionID;
    public String sidValue;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mActivity = this;
        setContentView(R.layout.activity_base);
        mLocalData = new LocalData(mActivity);
        sidValue = mLocalData.getString(LocalData.CacheKey.sessionID);
    }

    public int dp2px(float dipValue) {
        return DensityUtils.dp2px(this, dipValue);
    }

    public void showToast(String msg) {
        Toast.makeText(mActivity, msg, Toast.LENGTH_SHORT).show();
    }
}
